package com.melodyframe.tableland.engine.model.base;

/**
 * <h1>量化模型基础实现</h1>
 * 
 * @author ettear
 */
public abstract class AbstractQuantifiableModel implements QuantifiableModel {

    private int value;

    @Override
    public int getValue() {
        return value;
    }

    @Override
    public void setValue(int value) {
        this.value = value;
    }

    @Override
    public boolean greaterThan(int value) {
        return this.value > value;
    }

    @Override
    public boolean greaterThan(QuantifiableModel model) {
        return this.greaterThan(model.getValue());
    }

    @Override
    public void increase(int value) {
        this.value += value;
    }

    @Override
    public void increase(QuantifiableModel model) {
        this.increase(model.getValue());
    }

    @Override
    public void deduction(int value) {
        this.value -= value;
    }

    @Override
    public void deduction(QuantifiableModel model) {
        this.deduction(model.getValue());
    }
}
